package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by LN on 2018/1/5
 */
@Entity
@DynamicInsert
@Table(name = "sign_in_reissue_base")
public class SignInReissueBaseEntity extends BaseEntity{
    private String memberNo;
    private Integer total;
    private Integer used;
    private Date month;

    @Basic
    @Column(name = "member_no")
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @Column(name = "total")
    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    @Basic
    @Column(name = "used")
    public Integer getUsed() {
        return used;
    }

    public void setUsed(Integer used) {
        this.used = used;
    }

    @Basic
    @Column(name = "month")
    public Date getMonth() {
        return month;
    }

    public void setMonth(Date month) {
        this.month = month;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SignInReissueBaseEntity that = (SignInReissueBaseEntity) o;

        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        if (total != null ? !total.equals(that.total) : that.total != null) return false;
        if (used != null ? !used.equals(that.used) : that.used != null) return false;
        if (month != null ? !month.equals(that.month) : that.month != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = memberNo != null ? memberNo.hashCode() : 0;
        result = 31 * result + (total != null ? total.hashCode() : 0);
        result = 31 * result + (used != null ? used.hashCode() : 0);
        result = 31 * result + (month != null ? month.hashCode() : 0);
        return result;
    }
}
